
function calc(n1: number, n2: number, fn: (n1: number, n2: number) => number) {
    return fn(n1, n2)
}

const result = calc(10, 20, function (a1, a2) {
    return a1 + a2
})
console.log(result);

const result2 = calc(10, 20, function (a1, a2) {
    return a1 * a2
})
console.log(result2);

